<?php
/******************************************************* *   Copyright (C) 2007  http://p3net.net    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License along    with this program; if not, write to the Free Software Foundation, Inc.,    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    
    @id: $Id: globals.php 6 2007-07-27 19:03:49Z p3net.tech $
*********************************************************/
/* Include our larger functions */
require_once('./functions/db.php');
require_once('./functions/template.php');
require_once('./session.php');

/*The smaller ones*/
class error
{
	function general($err, $verbose)
	{
		$error =& new template('messages/error.tpl');
		$error->set('err', $err);
		$handle = fopen('logs/errors.txt', 'w');
		if($handle)
		{
			$entry = "[" . date('d M Y H:i:s') . "][" . $REMOTE_ADDR . "] " . $err . " - " . $verbose;
			if(!fwrite($handle, $entry))
			{
				continue();
			}
		}
		fclose($handle);
		exit();
	}
}
function message
{
	function thank($message, $go1, $res1, $go2="", $res2="")
	{
		$message =& new template('message/thank.tpl');
		$message->set('go1', $go1);
		$message->set('go2', $go2);
		$message->set('res1', $res1);
		$message->set('res2', $res2);
		$message->set('message', $message);
	}
}
$error =& new error;
$db =& new db;
$template =& new template;
$user =& new session();
$message =& new message();?>